#ifndef __RSA_H__
#define __RSA_H__ 

#include <openssl/rsa.h>  
#include <openssl/err.h>  
#include <openssl/pem.h>  
  
#include <iostream>  
#include <string>  
#include <cstring>  

#include <stdio.h>


class Rsa 
{
public:
	Rsa(const std::string& publicKeyFile, const std::string& privateKeyFile);
	~Rsa();

	bool encrypt(const std::string& in, std::string& out, const bool usePublicKey = true);
	bool decrypt(const std::string& in, std::string& out, const bool usePublicKey = false);

private:
	Rsa();	
	bool crypt(const std::string& in, std::string& out, const bool encrypt, const bool usePublicKey);

	std::string _publicKeyFile;
	std::string _privateKeyFile;
};


#endif 



